{include file="home/include/header.html"}
<!-- Page Banner Start -->
<div class="page-banner section">
    <div class="container">
        <div class="page-banner-wrapper text-center">
            <h2 class="title">Login</h2>
            <ul class="breadcrumb justify-content-center">
                <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                <li class="breadcrumb-item active">Login</li>
            </ul>
        </div>
    </div>
</div>
<!-- Page Banner End -->

<!-- Login & Register Start -->
<div class="section section-padding-02 mt-n1">
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-lg-6">
                <!-- Login & Register Start -->
                <div class="login-register-wrapper">
                    <h4 class="title">Login to Your Account</h4>
                    <form action="" method="post" class="login-from">
                        <div class="single-form">
                            <label>Username *</label>
                            <input type="text" name="username">
                        </div>
                        <div class="single-form">
                            <label>Password</label>
                            <input type="password" name="password">
                        </div>
                        <div class="single-form">
                            <input type="checkbox" id="remember">
                            <label for="remember"><span></span> Remember me</label>
                        </div>
                        <div class="single-form">
                            <button class="btn btn-primary btn-hover-dark rounded-pill btn-submit" type="button" data-from="login-from">Login</button>
                        </div>
                    </form>
                    <p><a href="#">Lost your password?</a></p>
                    <p>No account? <a href="/Index/register">Create one here.</a></p>
                </div>
                <!-- Login & Register End -->
            </div>
        </div>
    </div>
</div>
<!-- Login & Register End -->
{include file="home/include/footer.html"}
<script>
    {literal}
    $('.btn-submit').click(function(){
        let from = $(this).attr('data-from');
        let data = $('.' + from).serialize();
        data += '&platform=1';
        $.post('/api/member-api/login' , data , function(res){
            layer.msg(res.msg, {icon: res.code == 200 ? 1 : 5});
            if (res.code == 200){
                window.location.href = '/index/account';
            }
        } , 'json');
    })
    {/literal}
</script>